home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Video
/
World of Video.iso
/
gfxprograms
/
3dprograms
/
rayshade-4.0
/
unapplied
/
fix015.shadow-attenuation
next >
Wrap
Internet Message Format
|
1995-02-13
|
3KB
From theseas!fs.Princeton.EDU!cek Tue, 27 Jul 93 01:36:59 EET
Received: by kriton.UUCP (V1.16/Amiga)
id AA00000; Tue, 27 Jul 93 01:36:59 EET
Received: by theseas.ntua.gr with UUCP; Mon, 26 Jul 93 11:32:49 +0300
Received: from mcsun.EU.net by pythia.ics.forth.gr via ITEnet with SMTP;
id AA23349 (5.65c/FORTH-ICS-3.0-MHS-7.0); Mon, 26 Jul 1993 11:10:22 +0300
Received: by mcsun.EU.net with UUCP
id AA16480 (5.65b/CWI-2.220); Mon, 26 Jul 1993 10:09:08 +0200
Received: from Princeton.EDU by relay2.UU.NET with SMTP
(5.61/UUNET-internet-primary) id AB24006; Mon, 26 Jul 93 04:08:20 -0400
Received: from fs.Princeton.EDU by Princeton.EDU (5.65b/2.97/princeton)
id AA28530; Mon, 26 Jul 93 04:05:27 -0400
Received: by fs.Princeton.EDU (4.1/1.105)
id AA03176; Mon, 26 Jul 93 04:05:26 EDT
Received: from fsa.cpsc.ucalgary.ca by fs.Princeton.EDU (4.1/1.105)
id AA03094; Mon, 26 Jul 93 04:04:39 EDT
Received: from fsd.cpsc.ucalgary.ca by fsa.cpsc.ucalgary.ca (4.1/CSd1.2)
id <AA03696@fsa.cpsc.ucalgary.ca>; Mon, 26 Jul 93 02:02:04 MDT
Received: by fsd.cpsc.ucalgary.ca (5.67/cs1.0)
id AA28555; Mon, 26 Jul 93 02:02:11 -0600
Date: Mon, 26 Jul 93 02:02:11 -0600
Message-Id: <9307260802.AA28555@fsd.cpsc.ucalgary.ca>
Errors-To: Princeton.EDU!cek
Remailed-Date: Mon Jul 26 04:04:42 EDT 1993
From: cpsc.ucalgary.ca!jamesm (Mark James)
To: Rayshade Mailing List <cs.Princeton.EDU!rayshade-users>
Subject: ligthing models
Since quite a few people have asked for my shadow attenuation
patches, and they're quite small, I'll just send them to everyone...
Currently the only way to change the parameter "ts" is to change the
code. :) The Graphics Gems article says:
Setting ts = 0.6 works well in most cases.
M.
--------- Cut Here ------------------
*** ./libray/liblight/shadow.c Sun Feb 9 20:04:06 1992
--- ../caustics/./libray/liblight/shadow.c Tue Feb 23 20:43:11 1993
***************
*** 63,68 ****
--- 63,70 ----
Surface surf, *sptr, *prevsurf;
Float s, totaldist, statten;
Color res;
+ double ts=0.6;
+ double tm;
if (noshadow || NOSHADOWS(ShadowOptions)) {
*result = *color;
***************
*** 196,205 ****
prevsurf = &surf;
else
prevsurf = (Surface *)NULL;
/*
* Attenuate light source by body color of surface.
*/
! ColorScale(surf.transp, res, &res);
ColorMultiply(res, surf.body, &res);
/*
* Return if attenuation becomes large.
--- 198,210 ----
prevsurf = &surf;
else
prevsurf = (Surface *)NULL;
+
+ VecNormalize( &norm );
+ tm=1+fabs(dotp(&norm,&(ray->dir))*ts);
/*
* Attenuate light source by body color of surface.
*/
! ColorScale(surf.transp*tm, res, &res);
ColorMultiply(res, surf.body, &res);
/*
* Return if attenuation becomes large.
--------- Cut Here ------------------
----------
Administrivia: rayshade-request@cs.princeton.edu
Mailing list: rayshade-users@cs.princeton.edu